package com.ruoyi.web.api;

import com.ruoyi.abuwx.domain.dto.AppLoginBody;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.web.service.AppLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zouhuu
 * @description 授权认证API
 * @date 2022/06/15 15:43:07
 */

@RestController
@RequestMapping("/api/auth")
public class AuthApi {

    @Autowired
    private AppLoginService appLoginService;

    @PostMapping("/wxmlogin")
//    @ApiOperation("微信小程序登录")
    public AjaxResult wxmlogin(@RequestBody AppLoginBody loginBody) {
        return AjaxResult.success(appLoginService.wxmLogin("wxabfb91983057efc9", loginBody.getCode(), loginBody.getWxUserInfo()));
    }
}
